//
//  WSListHeadView.m
//  GroupFourFM
//
//  Created by dllo on 15/12/24.
//  Copyright © 2015年 GroupFour. All rights reserved.
//

#import "WSListHeadView.h"

@interface WSListHeadView ()

@property (nonatomic, strong) UIImageView *arrowImageView;

@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation WSListHeadView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        [self createSubView];
    }
    return self;
}

- (void)createSubView {
    
    self.arrowImageView = [[UIImageView alloc] init];
    self.arrowImageView.backgroundColor = CLEAR;
    self.arrowImageView.image = [UIImage imageNamed:@"findsection_logo"];
    [self addSubview:self.arrowImageView];
    
    [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(@20);
        make.left.mas_equalTo(@10);
        make.width.mas_equalTo(@10);
        make.height.mas_equalTo(@13);
    }];
    
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.backgroundColor = CLEAR;
    self.titleLabel.textColor = [UIColor colorWithRed:0.27 green:0.27 blue:0.27 alpha:1];
    [self addSubview:self.titleLabel];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.arrowImageView).offset(-3);
        make.left.equalTo(self.arrowImageView.mas_right).offset(10);
        make.height.mas_equalTo(@17);
        make.width.mas_equalTo(@100);
    }];
    
}

- (void)setTitle:(NSString *)title {
    
    _title = title;
    self.titleLabel.text = _title;
}

@end
